{% if is_paginated %}
<div class="pagination">
    {% if page_obj.has_previous %}
    <a href="?page=1{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.type %}&type={{ request.GET.type }}{% endif %}" class="page-link">&laquo; 首页</a>
    <a href="?page={{ page_obj.previous_page_number }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.type %}&type={{ request.GET.type }}{% endif %}" class="page-link">上一页</a>
    {% endif %}

    <span class="current">
        第 {{ page_obj.number }} 页，共 {{ page_obj.paginator.num_pages }} 页
    </span>

    {% if page_obj.has_next %}
    <a href="?page={{ page_obj.next_page_number }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.type %}&type={{ request.GET.type }}{% endif %}" class="page-link">下一页</a>
    <a href="?page={{ page_obj.paginator.num_pages }}{% if request.GET.search %}&search={{ request.GET.search }}{% endif %}{% if request.GET.type %}&type={{ request.GET.type }}{% endif %}" class="page-link">末页 &raquo;</a>
    {% endif %}
</div>
{% endif %} 